public class swop {
    //需求：定义一个数组，存入7, 2, 3,4, 5。按照要求交换索引对应的元素。
    //交换前：1, 2, 3, 4, 5
    //交换后：5, 2, 3, 4, 1
    public static void main(String[] args) {
        int nex  = 4;
        int arr[] = {1, 2, 3, 4, 5};
        int newArr[] = new int[5];
        for (int i = 0; i < arr.length; i++) {
            newArr[nex] = arr[i];
            nex--;
        }
        for (int i = 0; i < newArr.length; i++) {
            System.out.print( + newArr[i] + " ");
        }
    }
}
